







[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Finds the maximum value in a collection. A supplied Comparison<T> delegate is used
to compare the items in the collection.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
public static T Maximum<T>( IEnumerable<T> collection, Comparison<T> comparison ) |
Visual Basic (Declaration) |
---|
Public Shared Function Maximum(Of T) ( _ collection As IEnumerable(Of T), _ comparison As Comparison(Of T) _ ) As T |
Visual C++ |
---|
public: generic<typename T> static T Maximum ( IEnumerable<T>^ collection, Comparison<T>^ comparison ) |
Parameters
- collection
- IEnumerable<(Of <T>)>
The collection to search.
- comparison
- Comparison<(Of <T>)>
The comparison used to compare items in the collection.
Return Value
The largest item in the collection.
Type Parameters
- T
- The type of items in the collection.
Exceptions
Exception | Condition |
---|---|
System..::InvalidOperationException | The collection is empty. |
System..::ArgumentNullException | collection or comparison is null. |
See Also
Algorithms Class
Wintellect.PowerCollections Namespace